var settlement = new Vue({
		el: "#app",
		data() {
			return {
				allChecked: false, //全选状态  true|false
				Data: [{
					text: '准上人关热与相青音铁构素法百',
					text1: '标准装:3盒装',
					price: 15.9,
					num: 1,
				}, {
					text: '准上人关热与相青音铁构素法百',
					text1: '标准装:3盒装',
					price: 15.3,
					num: 1,
				}, {
					text: '准上人关热与相青音铁构素法百',
					text1: '标准装:3盒装',
					price: 15.3,
					num: 1,
				}, ]
			}
		},
		//计算属性	
		computed: {
			totalPrice() { //总价
				let totalPrice = 0
				for (let i = 0; i < this.Data.length; i++) {
					totalPrice += this.Data[i].price * this.Data[i].num
				}
				return Number(totalPrice.toFixed(2)); //总价
			},
			sum() { //总数
				let sum = 0
				for (let i = 0; i < this.Data.length; i++) {
					sum += this.Data[i].num
				}
				return sum; //总数
			},
		},
		//监听属性
		watch: {

		},
		//钩子函数	
		created() {

		},
		mounted() {

		},
		methods: {
			jian(item) {
				let num = item.num
				if (num > 0) {
					num -= 1
				} else {
					num = 0
					return
				}
				item.num = num
				console.log(item.num)
			},
			jia(item) {
				let num = item.num
				item.num = num + 1
				console.log(item.num)
			},
			modify_the_address: function() {
				window.location.href = "address_to_add.html"
			},
			click: function() {
				this.allChecked = !this.allChecked;
				console.log(this.allChecked);
			}
		}
	})
